{% extends "goflow/base_site.html" %}
{% load i18n %}
{% block content %}
<h1>Demonstration of leave request</h1>
<ul>
{% if user.is_authenticated and user.is_staff %}
<li><a href="mywork/">See your worklist</a> ({{user.username}})</li>
<li><a href="myrequests/">See what you have requested</a></li>
{% else %}
<li><a href=accounts/login/?next=home/>{% trans 'Log in' %}</a></li>
{% endif %}

<li><form method=get action="otherswork/">Worklist of
<select name=worker>
<option>notarius</option>

<option>prefectus</option>
<option>primus</option>
<option>quartus</option>
<option>secundus</option>
<option>socius</option>
<option>tertius</option>
</select>
<input type="submit" value="Peek">
 </form></li>
</ul>

<h2>Initialization of a workflow</h2>
<p>
<img src="/images/leaveactivities.png" align="right">
This is a workflow for leave/vacation requests. In free from the workflow is this:
You acting as an employee request leave by filling out a form.
The request goes to the secretary (<a href="otherswork?worker=notarius">Notarius</a>
or <a href="otherswork?worker=socius">Socius</a>) who
checks that you have the needed days on your account. If this goes well he forwards the request
to <a href="otherswork?worker=prefectus">Prefectus</a> for approval.
If not approved, it is sent back to the employee for either modification or cancellation.
</p>
<p>
Prefectus will either approve or not. If he approves the request is sent to the secretary of the employee
for update in HR's system.
If he doesn't approve the request is sent back to the employee.
The secretary will subtract the days from HR and then inform the employee that the leave is approved.
</p>

<p>
This workflow is an example of explicit forwarding to the secretary, supervisor and employee.
The system is programmed to figure out who your secretary is, and in this example
Primus, Secundus, Socius and Prefectus has Notarius as their secretary.
Tertius, Quartus and Notarius
has Socius. Everybody has Prefectus as supervisor - even Prefectus.
</p>
<ul>
{% if user.is_authenticated and user.is_staff %}
<li><a href="start/">Request leave/vacation</a></li>
{% else %}
<li><a href=accounts/login/?next=home/>login in order to make a leave/vacation request</a></li>
{% endif %}
</ul>
<p>
All account names are spelled in all lowercase. The password is the first letter of the
account name.
</p>
<h3>Excercises for the reader</h3>
<ol>
<li>The <i>Check Formalia</i> activity is a good candidate for automatisation.</li>

<li>Rather than assigning the <i>Update HR System</i> to a specific secretary,
you can let them draw the tasks from a shared pool. All you have to do is
to remove the incoming routing on that activity and make the activity pullable
by the Secretary role. But remember the observation: When it is everybody's
responsibility - it is nobody's responsibility.</li>
<li>Finally, you could make it possible for the requester to withdraw his request
while it's inactive on the secretary's and supervisor's work queue.</li>
</ol>
{% endblock %}
